/**
 * Created by fanweihua on 2016/12/2.
 */
import React from 'react';
import GalleryHtml from './galleryHtml.js';

const Gallery = React.createClass({
    getInitialState: function () {
        return {
            html: GalleryHtml.html
        };
    },
    render(){
        return (
            <div className="Z_slideIn">
                <div className="page slideIn">
                    <div className="Z_content_code">
                        <div dangerouslySetInnerHTML={{__html: this.state.html}}></div>
                    </div>
                </div>
                <div className="Z_content">
                    <div className="Z_panel-body-backgound">
                        <GalleryNav></GalleryNav>
                    </div>
                </div>
            </div>
        )
    }
});
module.exports = Gallery;
const GalleryNav = React.createClass({
    getInitialState: function () {
        return {
            backgroundImage: 'url(/bower_components/weui-master/example/images/pic_article.png)'
        };
    },
    componentDidMount: function () {
        $(".weui-gallery").css({
            "position": "absolute"
        })
    },
    render(){
        return (
            <div className="Z_panel-body">
                <div className="page__hd">
                    <h1 className="page__title">Gallery</h1>
                    <p className="page__desc">画廊，可实现上传图片的展示或幻灯片播放</p>
                </div>
                <div className="weui-gallery" style={{display: "block"}}>
                    <span className="weui-gallery__img"
                          style={{backgroundImage: this.state.backgroundImage}}></span>
                    <div className="weui-gallery__opr">
                        <a href="javascript:" className="weui-gallery__del">
                            <i className="weui-icon-delete weui-icon_gallery-delete"></i>
                        </a>
                    </div>
                </div>
            </div>
        );
    }
});